feat(vibenet): show gas token fee on explorer tx detail - #108
Merged
Conversation
The b20 demo pays gas by transferring the stablecoin fee to the AA payer as phase 0 of the batch, rather than through any dedicated receipt field, so the tx detail page only ever showed the ETH gas fee even when a token was used to pay it. Detect the phase-0 transfer(payer, amount) pattern and render it as a "Gas token fee" row alongside the existing ETH gas rows.
Collaborator
✅ Heimdall Review Status
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Resolve the paid token's symbol/decimals via an on-chain read (the receipt has no metadata for it) and show a proper amount + symbol instead of raw units. When gas was paid in a token, the ETH "Fee" row is redundant with what the payer actually covered, so hide it in that case.
Fully hiding the ETH fee when gas was paid in a token loses the one number that shows whether the payer's flat token fee actually covers what it spends in ETH. Relabel it "Network cost (paid by payer)" instead of dropping it, so it reads as debugging info rather than what the user paid.
danyalprout
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
findGasTokenFeeinapp/vibenet/library/explorer.ts, which detects that phase-0 pattern (a lonetransfer(payer, amount)call) and returns the token contract + raw amount.app/vibenet/library/token.tsto resolve the token'ssymbol()/decimals()on chain (the receipt has no metadata for an arbitrary user-deployed b20 token), so the row reads e.g.0.1 RWRDinstead of raw units.Test plan
npx tsc --noEmit— cleannpx vitest run app/vibenet/library/explorer.test.ts— 29/29 passing (3 new cases forfindGasTokenFee: happy path, no-payer/no-aa, false-positive guards)npx eslinton changed files — no new warnings/errors beyond pre-existing ones in this fileBefore
After
